package cn.com.xuhx.pojo;

import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.util.Date;

@TableName("T_USERS")
public class User implements Serializable {

    /**
     * @TableId
     *  作用：设置主键（当主键属性为id时，可以不加）
     *      属性：
     *          - value：当数据库主键的字段名与当前实体的字段名不一致时，使用value对应映射关系
     *          - type：主键生成策略。
     *              - IdType.AUTO：自增（要求数据库主键设置自动递增）
     *              - IdType.ASSIGN_ID：默认值（雪花算法）
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    //作用：当数据库的字段名与当前实体的字段名不一致时，使用TableField对应映射关系
    @TableField("name")
    private String name;

    private Integer age;

    private String address;

    private String tel;

    private String sfzh;

    private Date bornday;

    //TableLogic:作用：逻辑删除，当用户有需求不让真的删除库里的数据的时候，加上此注解可以把delete操作变成修改库中删除状态的update操作，并且查询时是看不到逻辑删除的数据
    @TableLogic(delval = "1")
    @TableField("delStatus")
    private Integer delStatus;

    private static final long serialVersionUID = 1L;

    public User(Long id, String name, Integer age, String address, String tel, String sfzh, Date bornday) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.address = address;
        this.tel = tel;
        this.sfzh = sfzh;
        this.bornday = bornday;
    }

    public User(String name, Integer age, String address, String tel, String sfzh, Date bornday) {
        this.name = name;
        this.age = age;
        this.address = address;
        this.tel = tel;
        this.sfzh = sfzh;
        this.bornday = bornday;
    }

    public User() {
        super();
    }

    public Integer getDelStatus() {
        return delStatus;
    }

    public void setDelStatus(Integer delStatus) {
        this.delStatus = delStatus;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel == null ? null : tel.trim();
    }

    public String getSfzh() {
        return sfzh;
    }

    public void setSfzh(String sfzh) {
        this.sfzh = sfzh == null ? null : sfzh.trim();
    }

    public Date getBornday() {
        return bornday;
    }

    public void setBornday(Date bornday) {
        this.bornday = bornday;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                ", tel='" + tel + '\'' +
                ", sfzh='" + sfzh + '\'' +
                ", bornday=" + bornday +
                '}';
    }
}